package com.platform.framework.realm;


import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.subject.PrincipalCollection;

/**
 * 2016/11/4
 * @author ly-liugaoyang
 * Shiro Realm
 */
public class MyRealm extends AuthorizingRealm{

	@Override
	protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
		return null;
	}

	@Override
	protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
		return null;
//		String userName=(String) token.getPrincipal();
//		Blogger blogger=bloggerService.getByUserName(userName);
//		if(blogger!=null){
//			SecurityUtils.getSubject().getSession().setAttribute("currentUser", blogger); // �ѵ�ǰ�û���Ϣ�浽session��
//			AuthenticationInfo authcInfo=new SimpleAuthenticationInfo(blogger.getUserName(), blogger.getPassword(), "xxx");
//			return authcInfo;
//		}else{
//			return null;			
//		}
	}

}
